Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 1 - Appearance Manager Reference / Appearance Manager Functions
Coordinating Colors and Patterns With the Current Theme /


SetThemePen

NEW WITH THE APPEARANCE MANAGER

Sets an element's pen pattern or color to comply with the current theme.

pascal OSStatus SetThemePen (
                     ThemeBrush inBrush,
                     SInt16 inDepth,
                     Boolean inIsColorDevice);
inBrush
A value representing the pattern or color to which the pen is to be set; see "Appearance-Compliant Brush Type Constants".
inDepth
The bit depth (in pixels) of the current graphics port.
inIsColorDevice
A Boolean value. Set to true to indicate that you are drawing on a color device. Set to false for a monochrome device.
function result
A result code. The result code appearanceBadBrushIndexErr indicates that the brush constant passed in was not valid. For a list of other result codes, see "Result Codes".
DISCUSSION
The SetThemePen function should be called each time you wish to draw an element in a specified brush constant using Appearance Manager draw functions.

The constant in the inBrush parameter can represent a color or pattern, depending on the current theme. Because it could specify a pattern, remember to save and restore the pnPixPat and bkPixPat fields of your graphics port when saving the text and background colors. Because patterns in the pnPixPat field override the foreground color of the window, call the Window Manager function PenPat to set your foreground pattern to a normal white pattern. This will ensure that you can use RGBForeColor to set your foreground color to white, call the Window Manager function PaintRect, and get the expected results.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998